<template lang="pug">
transition(name="screening")
  .screening-mask(v-if="show" @click.self="close")
    .screening
      .screening-container
        .attr-contant
          .attr-item(v-for="item in attrs")
            .attr-item-label {{item.attributeName}}
            .attr-item-value {{item.attributeValues}}
</template>

<script>
export default {
  name: 'filterModal',
  props: {
    show: Boolean,
    attrs: Array
  },
  methods: {
    close () {
      this.$emit('close')
    },
  },
}
</script>

<style lang="scss" scoped>
.screening-leave-active {
  transition: opacity .3s ease;
}
.screening-enter-active,.screening-leave-active {
  opacity: 0
}
.screening-enter-active .screening,
.screening-leave-active .screening {
  transform: translateX(100%);
  opacity: 0;
}
.screening-mask {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  z-index: 8888;
  background: rgba(0,0,0,.5)
}
.screening {
  transition: all .3s;
  position: fixed;
  width: 400px;
  height: 100%;
  top: 0;
  right: 0;
  background: #f5f5f5;
  z-index: 9999;
}
.screening-container {
  height: 100%;
  padding: 20px 0;
}
.attr-contant {
  display: flex;
  flex-wrap: wrap;
  .attr-item {
    width: 50%;
    padding: 10px 20px;
    .attr-item-label {
      font-size: 14px;
      color: #999;
    }
    .attr-item-value {
      font-size: 16px;
      font-weight: bold;
      margin-top: 10px;
    }
  }
}
</style>